import httpFetch from "share/httpFetch";

export default {
  //编辑会计期间定义
  savePeriodDefine(params) {
    return httpFetch[params.id ? 'put' : 'post'](`/api/periodset`, params)
  },

  getPeriodInfo(id) {
    return httpFetch.get(`/api/periodset/${id}`)
  },

  getAccountRuleList(id) {
    return httpFetch.get(`/api/periodrule/query?periodSetId=${id}`)
  },

  createPeriod(params) {
    return httpFetch.post(`/api/periods/batch/create/periods?periodSetCode=${params.periodSetCode}&yearFrom=${params.yearFrom}&yearTo=${params.yearTo}`)
  },

  newAccountRule(params) {
    return httpFetch.post(`/api/periodrule/batch`, params)
  },

  defaultRule(id) {
    return httpFetch.post(`/api/periodrule/default?periodSetId=${id}`)
  }
}

